library(readr)
sparrows <- read_csv("~/Desktop/Parthvi/MITA/SEM2/MVA/Bumpus_sparrows.csv")
## Rows: 49 Columns: 6
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (1): Survivorship
## dbl (5): Total_length, Alar_extent, L_beak_head, L_humerous, L_keel_sternum
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
str(sparrows)
## spc_tbl_ [49 × 6] (S3: spec_tbl_df/tbl_df/tbl/data.frame)
##  $ Survivorship  : chr [1:49] "S" "S" "S" "S" ...
##  $ Total_length  : num [1:49] 156 154 153 153 155 163 157 155 164 158 ...
##  $ Alar_extent   : num [1:49] 245 240 240 236 243 247 238 239 248 238 ...
##  $ L_beak_head   : num [1:49] 31.6 30.4 31 30.9 31.5 32 30.9 32.8 32.7 31 ...
##  $ L_humerous    : num [1:49] 18.5 17.9 18.4 17.7 18.6 19 18.4 18.6 19.1 18.8 ...
##  $ L_keel_sternum: num [1:49] 20.5 19.6 20.6 20.2 20.3 20.9 20.2 21.2 21.1 22 ...
##  - attr(*, "spec")=
##   .. cols(
##   ..   Survivorship = col_character(),
##   ..   Total_length = col_double(),
##   ..   Alar_extent = col_double(),
##   ..   L_beak_head = col_double(),
##   ..   L_humerous = col_double(),
##   ..   L_keel_sternum = col_double()
##   .. )
##  - attr(*, "problems")=<externalptr>
boxplot(sparrows[,2:6])

stars(sparrows,labels = sparrows$Survivorship)

# Dive Deeper into Visualization Techniques
# using the economist theme in plots 
attach(sparrows)

#Plots
sparr.birds <- data.frame(as.numeric(rownames(sparrows)),sparrows[,2:6])

labs.diagonal <- c("Bird","Total length","Alar extent","L. beak & head","L. humerous","L. keel & sternum")

plot(Total_length, Alar_extent,xlab="Total Length (mm)",ylab="Alar extent (nm)",pch=c(16,1))

# Correlations
pairs(sparrows[,2:6])

# Scatter Plot Matrix
#Scatterplot matrix is a collection of scatterplots being organized into a matrix, 
#and each scatterplot shows the relationship between a pair of variables.
library(car)
## Loading required package: carData
scatterplotMatrix(~Total_length+Alar_extent+L_beak_head+L_humerous+L_keel_sternum | Survivorship, data=sparr.birds, var.labels=labs.diagonal,cex.labels=0.7, diagonal="boxplot",smooth=FALSE,reg.line=FALSE,pch=c(1,16),col=rep("black",2), legend.plot=FALSE)
## Warning in applyDefaults(diagonal, defaults = list(method = "adaptiveDensity"),
## : unnamed diag arguments, will be ignored
## Warning in plot.window(...): "reg.line" is not a graphical parameter
## Warning in plot.window(...): "legend.plot" is not a graphical parameter
## Warning in plot.xy(xy, type, ...): "reg.line" is not a graphical parameter
## Warning in plot.xy(xy, type, ...): "legend.plot" is not a graphical parameter
## Warning in title(...): "reg.line" is not a graphical parameter
## Warning in title(...): "legend.plot" is not a graphical parameter
## Warning in plot.window(...): "reg.line" is not a graphical parameter
## Warning in plot.window(...): "legend.plot" is not a graphical parameter
## Warning in plot.xy(xy, type, ...): "reg.line" is not a graphical parameter
## Warning in plot.xy(xy, type, ...): "legend.plot" is not a graphical parameter
## Warning in title(...): "reg.line" is not a graphical parameter
## Warning in title(...): "legend.plot" is not a graphical parameter
## Warning in axis(side = side, at = at, labels = labels, ...): "reg.line" is not
## a graphical parameter
## Warning in axis(side = side, at = at, labels = labels, ...): "legend.plot" is
## not a graphical parameter
## Warning in plot.window(...): "reg.line" is not a graphical parameter
## Warning in plot.window(...): "legend.plot" is not a graphical parameter
## Warning in plot.xy(xy, type, ...): "reg.line" is not a graphical parameter
## Warning in plot.xy(xy, type, ...): "legend.plot" is not a graphical parameter
## Warning in title(...): "reg.line" is not a graphical parameter
## Warning in title(...): "legend.plot" is not a graphical parameter
## Warning in plot.window(...): "reg.line" is not a graphical parameter
## Warning in plot.window(...): "legend.plot" is not a graphical parameter
## Warning in plot.xy(xy, type, ...): "reg.line" is not a graphical parameter
## Warning in plot.xy(xy, type, ...): "legend.plot" is not a graphical parameter
## Warning in title(...): "reg.line" is not a graphical parameter
## Warning in title(...): "legend.plot" is not a graphical parameter
## Warning in axis(side = side, at = at, labels = labels, ...): "reg.line" is not
## a graphical parameter
## Warning in axis(side = side, at = at, labels = labels, ...): "legend.plot" is
## not a graphical parameter
## Warning in plot.window(...): "reg.line" is not a graphical parameter
## Warning in plot.window(...): "legend.plot" is not a graphical parameter
## Warning in plot.xy(xy, type, ...): "reg.line" is not a graphical parameter
## Warning in plot.xy(xy, type, ...): "legend.plot" is not a graphical parameter
## Warning in title(...): "reg.line" is not a graphical parameter
## Warning in title(...): "legend.plot" is not a graphical parameter
## Warning in axis(side = side, at = at, labels = labels, ...): "reg.line" is not
## a graphical parameter
## Warning in axis(side = side, at = at, labels = labels, ...): "legend.plot" is
## not a graphical parameter
## Warning in plot.window(...): "reg.line" is not a graphical parameter
## Warning in plot.window(...): "legend.plot" is not a graphical parameter
## Warning in plot.xy(xy, type, ...): "reg.line" is not a graphical parameter
## Warning in plot.xy(xy, type, ...): "legend.plot" is not a graphical parameter
## Warning in title(...): "reg.line" is not a graphical parameter
## Warning in title(...): "legend.plot" is not a graphical parameter
## Warning in axis(side = side, at = at, labels = labels, ...): "reg.line" is not
## a graphical parameter
## Warning in axis(side = side, at = at, labels = labels, ...): "legend.plot" is
## not a graphical parameter
## Warning in plot.window(...): "reg.line" is not a graphical parameter
## Warning in plot.window(...): "legend.plot" is not a graphical parameter
## Warning in plot.xy(xy, type, ...): "reg.line" is not a graphical parameter
## Warning in plot.xy(xy, type, ...): "legend.plot" is not a graphical parameter
## Warning in title(...): "reg.line" is not a graphical parameter
## Warning in title(...): "legend.plot" is not a graphical parameter
## Warning in plot.window(...): "reg.line" is not a graphical parameter
## Warning in plot.window(...): "legend.plot" is not a graphical parameter
## Warning in plot.xy(xy, type, ...): "reg.line" is not a graphical parameter
## Warning in plot.xy(xy, type, ...): "legend.plot" is not a graphical parameter
## Warning in title(...): "reg.line" is not a graphical parameter
## Warning in title(...): "legend.plot" is not a graphical parameter
## Warning in plot.window(...): "reg.line" is not a graphical parameter
## Warning in plot.window(...): "legend.plot" is not a graphical parameter
## Warning in plot.xy(xy, type, ...): "reg.line" is not a graphical parameter
## Warning in plot.xy(xy, type, ...): "legend.plot" is not a graphical parameter
## Warning in title(...): "reg.line" is not a graphical parameter
## Warning in title(...): "legend.plot" is not a graphical parameter
## Warning in plot.window(...): "reg.line" is not a graphical parameter
## Warning in plot.window(...): "legend.plot" is not a graphical parameter
## Warning in plot.xy(xy, type, ...): "reg.line" is not a graphical parameter
## Warning in plot.xy(xy, type, ...): "legend.plot" is not a graphical parameter
## Warning in title(...): "reg.line" is not a graphical parameter
## Warning in title(...): "legend.plot" is not a graphical parameter
## Warning in plot.window(...): "reg.line" is not a graphical parameter
## Warning in plot.window(...): "legend.plot" is not a graphical parameter
## Warning in plot.xy(xy, type, ...): "reg.line" is not a graphical parameter
## Warning in plot.xy(xy, type, ...): "legend.plot" is not a graphical parameter
## Warning in title(...): "reg.line" is not a graphical parameter
## Warning in title(...): "legend.plot" is not a graphical parameter
## Warning in plot.window(...): "reg.line" is not a graphical parameter
## Warning in plot.window(...): "legend.plot" is not a graphical parameter
## Warning in plot.xy(xy, type, ...): "reg.line" is not a graphical parameter
## Warning in plot.xy(xy, type, ...): "legend.plot" is not a graphical parameter
## Warning in title(...): "reg.line" is not a graphical parameter
## Warning in title(...): "legend.plot" is not a graphical parameter
## Warning in plot.window(...): "reg.line" is not a graphical parameter
## Warning in plot.window(...): "legend.plot" is not a graphical parameter
## Warning in plot.xy(xy, type, ...): "reg.line" is not a graphical parameter
## Warning in plot.xy(xy, type, ...): "legend.plot" is not a graphical parameter
## Warning in title(...): "reg.line" is not a graphical parameter
## Warning in title(...): "legend.plot" is not a graphical parameter
## Warning in plot.window(...): "reg.line" is not a graphical parameter
## Warning in plot.window(...): "legend.plot" is not a graphical parameter
## Warning in plot.xy(xy, type, ...): "reg.line" is not a graphical parameter
## Warning in plot.xy(xy, type, ...): "legend.plot" is not a graphical parameter
## Warning in title(...): "reg.line" is not a graphical parameter
## Warning in title(...): "legend.plot" is not a graphical parameter
## Warning in plot.window(...): "reg.line" is not a graphical parameter
## Warning in plot.window(...): "legend.plot" is not a graphical parameter
## Warning in plot.xy(xy, type, ...): "reg.line" is not a graphical parameter
## Warning in plot.xy(xy, type, ...): "legend.plot" is not a graphical parameter
## Warning in title(...): "reg.line" is not a graphical parameter
## Warning in title(...): "legend.plot" is not a graphical parameter
## Warning in axis(side = side, at = at, labels = labels, ...): "reg.line" is not
## a graphical parameter
## Warning in axis(side = side, at = at, labels = labels, ...): "legend.plot" is
## not a graphical parameter
## Warning in plot.window(...): "reg.line" is not a graphical parameter
## Warning in plot.window(...): "legend.plot" is not a graphical parameter
## Warning in plot.xy(xy, type, ...): "reg.line" is not a graphical parameter
## Warning in plot.xy(xy, type, ...): "legend.plot" is not a graphical parameter
## Warning in title(...): "reg.line" is not a graphical parameter
## Warning in title(...): "legend.plot" is not a graphical parameter
## Warning in axis(side = side, at = at, labels = labels, ...): "reg.line" is not
## a graphical parameter
## Warning in axis(side = side, at = at, labels = labels, ...): "legend.plot" is
## not a graphical parameter
## Warning in plot.window(...): "reg.line" is not a graphical parameter
## Warning in plot.window(...): "legend.plot" is not a graphical parameter
## Warning in plot.xy(xy, type, ...): "reg.line" is not a graphical parameter
## Warning in plot.xy(xy, type, ...): "legend.plot" is not a graphical parameter
## Warning in title(...): "reg.line" is not a graphical parameter
## Warning in title(...): "legend.plot" is not a graphical parameter
## Warning in plot.window(...): "reg.line" is not a graphical parameter
## Warning in plot.window(...): "legend.plot" is not a graphical parameter
## Warning in plot.xy(xy, type, ...): "reg.line" is not a graphical parameter
## Warning in plot.xy(xy, type, ...): "legend.plot" is not a graphical parameter
## Warning in title(...): "reg.line" is not a graphical parameter
## Warning in title(...): "legend.plot" is not a graphical parameter
## Warning in plot.window(...): "reg.line" is not a graphical parameter
## Warning in plot.window(...): "legend.plot" is not a graphical parameter
## Warning in plot.xy(xy, type, ...): "reg.line" is not a graphical parameter
## Warning in plot.xy(xy, type, ...): "legend.plot" is not a graphical parameter
## Warning in title(...): "reg.line" is not a graphical parameter
## Warning in title(...): "legend.plot" is not a graphical parameter
## Warning in plot.window(...): "reg.line" is not a graphical parameter
## Warning in plot.window(...): "legend.plot" is not a graphical parameter
## Warning in plot.xy(xy, type, ...): "reg.line" is not a graphical parameter
## Warning in plot.xy(xy, type, ...): "legend.plot" is not a graphical parameter
## Warning in title(...): "reg.line" is not a graphical parameter
## Warning in title(...): "legend.plot" is not a graphical parameter
## Warning in plot.window(...): "reg.line" is not a graphical parameter
## Warning in plot.window(...): "legend.plot" is not a graphical parameter
## Warning in plot.xy(xy, type, ...): "reg.line" is not a graphical parameter
## Warning in plot.xy(xy, type, ...): "legend.plot" is not a graphical parameter
## Warning in title(...): "reg.line" is not a graphical parameter
## Warning in title(...): "legend.plot" is not a graphical parameter
## Warning in axis(side = side, at = at, labels = labels, ...): "reg.line" is not
## a graphical parameter
## Warning in axis(side = side, at = at, labels = labels, ...): "legend.plot" is
## not a graphical parameter
## Warning in plot.window(...): "reg.line" is not a graphical parameter
## Warning in plot.window(...): "legend.plot" is not a graphical parameter
## Warning in plot.xy(xy, type, ...): "reg.line" is not a graphical parameter
## Warning in plot.xy(xy, type, ...): "legend.plot" is not a graphical parameter
## Warning in title(...): "reg.line" is not a graphical parameter
## Warning in title(...): "legend.plot" is not a graphical parameter
## Warning in plot.window(...): "reg.line" is not a graphical parameter
## Warning in plot.window(...): "legend.plot" is not a graphical parameter
## Warning in plot.xy(xy, type, ...): "reg.line" is not a graphical parameter
## Warning in plot.xy(xy, type, ...): "legend.plot" is not a graphical parameter
## Warning in title(...): "reg.line" is not a graphical parameter
## Warning in title(...): "legend.plot" is not a graphical parameter
## Warning in axis(side = side, at = at, labels = labels, ...): "reg.line" is not
## a graphical parameter
## Warning in axis(side = side, at = at, labels = labels, ...): "legend.plot" is
## not a graphical parameter
## Warning in plot.window(...): "reg.line" is not a graphical parameter
## Warning in plot.window(...): "legend.plot" is not a graphical parameter
## Warning in plot.xy(xy, type, ...): "reg.line" is not a graphical parameter
## Warning in plot.xy(xy, type, ...): "legend.plot" is not a graphical parameter
## Warning in title(...): "reg.line" is not a graphical parameter
## Warning in title(...): "legend.plot" is not a graphical parameter
## Warning in plot.window(...): "reg.line" is not a graphical parameter
## Warning in plot.window(...): "legend.plot" is not a graphical parameter
## Warning in plot.xy(xy, type, ...): "reg.line" is not a graphical parameter
## Warning in plot.xy(xy, type, ...): "legend.plot" is not a graphical parameter
## Warning in title(...): "reg.line" is not a graphical parameter
## Warning in title(...): "legend.plot" is not a graphical parameter
## Warning in axis(side = side, at = at, labels = labels, ...): "reg.line" is not
## a graphical parameter
## Warning in axis(side = side, at = at, labels = labels, ...): "legend.plot" is
## not a graphical parameter
## Warning in axis(side = side, at = at, labels = labels, ...): "reg.line" is not
## a graphical parameter
## Warning in axis(side = side, at = at, labels = labels, ...): "legend.plot" is
## not a graphical parameter
# scatterplot matrix giving a relationship between each variable using survivor and non-survivor groups 



library(lattice)

super.sym <- trellis.par.get("superpose.symbol")
super.sym$superpose.symbol$pch <- c(1,16,rep(1,5))
super.sym$superpose.symbol$col <- rep("#000000",7)
trellis.par.set(super.sym)
splom(~sparr.birds, groups = Survivorship, data = sparr.birds, ps=0.5, varname.cex = .5,panel = panel.superpose,key = list(columns = 2,points = list(pch = super.sym$pch[1:2], col=super.sym$col[1:2]),text = list(c("Non-survivor", "Survivor"))))

library(GGally)
## Loading required package: ggplot2
## Registered S3 method overwritten by 'GGally':
##   method from   
##   +.gg   ggplot2
ggscatmat(sparrows, columns=2:6, color="Survivorship")
## Warning: The dot-dot notation (`..scaled..`) was deprecated in ggplot2 3.4.0.
## ℹ Please use `after_stat(scaled)` instead.
## ℹ The deprecated feature was likely used in the GGally package.
##   Please report the issue at <]8;;https://github.com/ggobi/ggally/issueshttps://github.com/ggobi/ggally/issues]8;;>.

detach(sparrows)

# load packages
library(lattice)
library(ggplot2)
library(ggridges)
library(ggvis)
## 
## Attaching package: 'ggvis'
## 
## The following object is masked from 'package:ggplot2':
## 
##     resolution
library(ggthemes)
library(cowplot)
## 
## Attaching package: 'cowplot'
## 
## The following object is masked from 'package:ggthemes':
## 
##     theme_map
library(gapminder)
library(gganimate)
## No renderer backend detected. gganimate will default to writing frames to separate files
## Consider installing:
## - the `gifski` package for gif output
## - the `av` package for video output
## and restarting the R session
## 
## Attaching package: 'gganimate'
## 
## The following object is masked from 'package:ggvis':
## 
##     view_static
library(dplyr)
## 
## Attaching package: 'dplyr'
## 
## The following object is masked from 'package:car':
## 
##     recode
## 
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## 
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
library(tidyverse)
## ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.2 ──
## ✔ tibble  3.1.8     ✔ stringr 1.5.0
## ✔ tidyr   1.3.0     ✔ forcats 1.0.0
## ✔ purrr   1.0.1     
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter()     masks stats::filter()
## ✖ dplyr::lag()        masks stats::lag()
## ✖ dplyr::recode()     masks car::recode()
## ✖ ggvis::resolution() masks ggplot2::resolution()
## ✖ purrr::some()       masks car::some()
library(grid)
library(gridExtra)
## 
## Attaching package: 'gridExtra'
## 
## The following object is masked from 'package:dplyr':
## 
##     combine
library(RColorBrewer)

# Using Diamonds Data
data(sparrows)
## Warning in data(sparrows): data set 'sparrows' not found
attach(sparrows)

ggpairs(sparrows)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

# base R
plot(Total_length~Alar_extent)

plot(Total_length~Alar_extent)
abline(lm(Total_length~Alar_extent), col="red")

xyplot(Total_length~Alar_extent)

xyplot(Total_length~Alar_extent | Survivorship)

xyplot(Total_length~Alar_extent, groups=Survivorship)

xyplot(Total_length~Alar_extent | Survivorship + L_beak_head)

xyplot(Total_length~Alar_extent  | Survivorship , groups=Survivorship, auto.key=list(space="right"))

# ggplot
ggplot(sparrows, aes(x=Total_length,y=Alar_extent)) + geom_point() + theme_economist()

ggplot(sparrows, aes(x=Total_length,y=Alar_extent)) + facet_wrap(~Survivorship) + geom_point()+ theme_economist()

ggplot(sparrows, aes(x=Total_length, y=Alar_extent)) + geom_point(aes(color=Survivorship))+ theme_economist()

ggplot(sparrows, aes(x=Total_length,y=Alar_extent)) + xlim(0,3) + geom_point(colour="steelblue", pch=3) + 
  labs(x="total length of sparrows", y="tip to tip extended length", title="Sparrows Survival Data") 
## Warning: Removed 49 rows containing missing values (`geom_point()`).

# bar chart
ggplot(sparrows, aes(Survivorship)) + geom_bar(position="stack") + theme_economist()

ggplot(sparrows, aes(Survivorship)) + facet_grid(.~Total_length) + geom_bar(position="dodge") + theme_economist()

# histogram
ggplot(sparrows, aes(L_beak_head))+geom_histogram() + theme_economist()
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

ggplot(sparrows, aes(L_beak_head))+geom_histogram(aes(fill = after_stat(count))) + theme_economist()
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

# regression
ggplot(sparrows, aes(x=Total_length, y=Alar_extent)) + geom_point() + geom_smooth(method=lm) + theme_economist()
## `geom_smooth()` using formula = 'y ~ x'

ggplot(sparrows, aes(x=Total_length, y=Alar_extent)) + geom_point() + stat_smooth() + theme_economist()
## `geom_smooth()` using method = 'loess' and formula = 'y ~ x'

# violin plot 
#A violin plot is a hybrid of a box plot and a kernel density plot, 
#which shows peaks in the data. It is used to visualize the distribution of 
#numerical data. Unlike a box plot that can only show summary statistics, 
#violin plots depict summary statistics and the density of each variable.

ggplot(sparrows, aes(x=Total_length, y=Alar_extent)) + geom_violin() + theme_economist()

ggplot(sparrows, aes(x=Total_length, y=L_humerous)) + geom_violin() + theme_economist()

ggplot(sparrows, aes(x=Total_length, y=L_keel_sternum)) + geom_violin() + theme_economist()

# box plot
ggplot(sparrows, aes(x=Total_length, y=Alar_extent)) + geom_boxplot() + theme_economist()
## Warning: Continuous x aesthetic
## ℹ did you forget `aes(group = ...)`?

ggplot(sparrows, aes(x=Total_length, y=Alar_extent)) + geom_boxplot() + coord_flip() + theme_economist()
## Warning: Continuous x aesthetic
## ℹ did you forget `aes(group = ...)`?

# density plot and ggridges
#A density plot can be seen as an extension of the histogram. As opposed 
#to the histogram, the density plot can smooth out the distribution of 
#values and reduce the noise. It visualizes the distribution of data over 
#a given period, and the peaks show where values are concentrated.

ggplot(sparrows, aes(x=Total_length)) + geom_density() + theme_economist()

ggplot(sparrows, aes(x=Total_length, fill=Alar_extent, color=Survivorship)) + geom_density() + theme_economist()
## Warning: The following aesthetics were dropped during statistical transformation: fill
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?

ggplot(sparrows, aes(x=Total_length, fill=Alar_extent, color=Survivorship)) + geom_density(alpha=0.3, aes(y=..scaled..)) + theme_economist()
## Warning: The following aesthetics were dropped during statistical transformation: fill
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?

ggplot(sparrows, aes(x=Total_length, y=Survivorship)) + geom_density_ridges() + theme_economist()
## Picking joint bandwidth of 1.63

ggplot(sparrows, aes(x=Total_length)) + geom_density() + theme_economist()

# hexbin
#A hexbin plot is useful to represent the relationship of 2 numerical variables 
#when you have a lot of data points. Without overlapping of the points, 
#the plotting window is split into several hexbins. The color of each hexbin
#denotes the number of points in it. Like in our case the Maximum count is of 5 
ggplot(sparrows, aes(x=Total_length, y=Survivorship)) + geom_hex() + theme_economist()

lastplot <- ggplot(sparrows, aes(x=Total_length, y=Alar_extent)) + xlim(0,3) + geom_point(aes(color=Survivorship)) + stat_smooth() + 
  labs(x="total length of sparrows", y="tip to tip extended length", title="Sparrows Survival Data") 

lastplot + theme_bw()
## `geom_smooth()` using method = 'loess' and formula = 'y ~ x'
## Warning: Removed 49 rows containing non-finite values (`stat_smooth()`).
## Warning: Removed 49 rows containing missing values (`geom_point()`).

lastplot + theme_cowplot()
## `geom_smooth()` using method = 'loess' and formula = 'y ~ x'
## Warning: Removed 49 rows containing non-finite values (`stat_smooth()`).
## Removed 49 rows containing missing values (`geom_point()`).

lastplot + theme_dark()
## `geom_smooth()` using method = 'loess' and formula = 'y ~ x'
## Warning: Removed 49 rows containing non-finite values (`stat_smooth()`).
## Removed 49 rows containing missing values (`geom_point()`).

lastplot + theme_economist()
## `geom_smooth()` using method = 'loess' and formula = 'y ~ x'
## Warning: Removed 49 rows containing non-finite values (`stat_smooth()`).
## Removed 49 rows containing missing values (`geom_point()`).

lastplot + theme_fivethirtyeight()
## `geom_smooth()` using method = 'loess' and formula = 'y ~ x'
## Warning: Removed 49 rows containing non-finite values (`stat_smooth()`).
## Removed 49 rows containing missing values (`geom_point()`).

lastplot + theme_tufte()
## `geom_smooth()` using method = 'loess' and formula = 'y ~ x'
## Warning: Removed 49 rows containing non-finite values (`stat_smooth()`).
## Removed 49 rows containing missing values (`geom_point()`).

lastplot + theme_wsj()
## `geom_smooth()` using method = 'loess' and formula = 'y ~ x'
## Warning: Removed 49 rows containing non-finite values (`stat_smooth()`).
## Removed 49 rows containing missing values (`geom_point()`).